//
//  NSObject+Upload.h
//  MCCSframework
//
//  Created by qq on 2019/8/15.
//  Copyright © 2019 yhy. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <Photos/Photos.h>

NS_ASSUME_NONNULL_BEGIN

@class RACSignal;
@interface NSObject (Upload)
// MARK: - 上传 NSData
-(RACSignal*)uploadData:(NSData*)data toUrl:(NSString*)url fileName:(NSString*)fileName headers:(NSDictionary<NSString*,NSString*>*)headers;
// MARK: - 上传 PHAsset
+(RACSignal* )uploadAsset:(PHAsset*)asset headers:(NSDictionary<NSString*,NSString*>*)headers toUrl:(NSString*)url;
// MARK: --- 增加 key 参数——即 file 表单 key
-(RACSignal*)uploadData:(NSData*)data toUrl:(NSString*)url key:(NSString*)key fileName:(NSString*)fileName headers:(NSDictionary<NSString*,NSString*>*)headers;
// MARK: - 上传 PHAsset，指定表单key
+(RACSignal*)uploadAsset:(PHAsset*)asset key:(NSString*)key headers:(NSDictionary<NSString*,NSString*>*)headers toUrl:(NSString*)url;
@end

NS_ASSUME_NONNULL_END
